<?php

namespace App\Repositories\Transformers;

use App\Models\VolunteerActivity;
use League\Fractal\TransformerAbstract;

class VolunteerActivityTransformer extends TransformerAbstract
{
    public function transform(VolunteerActivity $volunteerActivity)
    {
      

        return [
            'id' => $volunteerActivity->id,
            'title' => $volunteerActivity->title,
            'image' => $volunteerActivity->image,
            'content' => html_entity_decode($volunteerActivity->content),
            'sign_up_start' => $volunteerActivity->sign_up_start,
            'sign_up_end' => $volunteerActivity->sign_up_end,
            'activity_time_start' => $volunteerActivity->activity_time_start,
            'activity_time_end' => $volunteerActivity->activity_time_end,
            'limit_count' => $volunteerActivity->limit_count,
            'post_count' => $volunteerActivity->post_count,
            'service_object' => $volunteerActivity->service_object,
            'volunteer_support' => $volunteerActivity->volunteer_support,
            'service_time' => $volunteerActivity->service_time,
            'status' => $volunteerActivity->status,
            'volunteer_form_count' => $volunteerActivity->volunteer_form_count ?? 0,
        ];
    }
}
